home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / bbs_soft / mrun210.zip / MRUN210C.WAS < prev    next >
Text File  |  1993-04-28  |  24KB  |  987 lines

  1. ;MailRun v2.10:  Part C, changebbs
  2. ;1992-1993 Gerald P. Sully, all rights reserved.
  3.  
  4. #comment
  5. **************************************************************************
  6. **************************************************************************
  7. * This file contains routines related to changing BBS settings.
  8. * Settings are divided into three groups, each with its own
  9. * dialog box:  BBS Settings, BBS Prompts, and Mail Door Prompts.
  10. * The appropriate routine is selected with a FLAG.
  11. **************************************************************************
  12. **************************************************************************
  13. #endcomment
  14.  
  15. #define MRUN210C
  16. #define MRUN210BC
  17.  
  18. #include "mrun210.h"
  19.  
  20. string ProtList, ArcList, MailDoorList, BBSTypeList
  21.  
  22.  
  23. #comment
  24. *********************************************************************
  25. * MAIN()
  26. * Calls checkchild(), makemaildoorlist(), menudim(),
  27. * makebbstypelist(), makeprotlist(), changeprompts(),
  28. * changeuserinfo(), changemaildoor()
  29. * Dispatches the appropriate command based on the value
  30. * of FLAGS.
  31. *********************************************************************
  32. #endcomment
  33.  
  34. proc main
  35. integer cmdstatus
  36.     menudim()
  37.     checkchild()
  38.     findfirst MailRun
  39.     MailRunTrunc = $FILENAME
  40.     makeprotlist()
  41.     makebbstypelist()
  42.     makemaildoorlist()
  43.     cmdstatus = FLAGS & (USR + PRMPT + QMD)
  44.     switch cmdstatus
  45.         case USR
  46.             changeuserinfo()
  47.         endcase
  48.         case PRMPT
  49.             changeprompts()
  50.         endcase
  51.         case QMD
  52.             changemaildoor()
  53.         endcase
  54.     endswitch
  55. endproc
  56.  
  57.  
  58. #comment
  59. *********************************************************************
  60. * CHANGEUSERINFO()
  61. * Called by main()
  62. * Calls getbbsi(), makebbslist(), loadbbsinfo(),
  63. * loadprompts(), loadmaildoor(), writebbsinfo(),
  64. * writeprompts(),  writemaildoor(), interfaceon(),
  65. * bbsbox(), addbbs(), defaultsprompts(), defaultsdoor(), 
  66. * cfgprompts(), cfgmaildoor(), writenewbbs(), checkchanged(),
  67. * getbbscoord(), gettaskstring()
  68. * Puts up the BBS Information dialog box and allows the
  69. * user to change the values for the current BBS.  If the
  70. * the DEFAULTS flag is set, changes the DEFAULT BBS
  71. * settings.  If the NEW flag is set, calls addbbs().
  72. *********************************************************************
  73. #endcomment
  74.  
  75. proc changeuserinfo
  76. string LastBBS, LastMRun, LastBBSType
  77. integer dialogstatus, i, j, NameChanged
  78.     i = getbbsi()
  79.     j = getitemi()
  80.     NameChanged = 0
  81.     profilerd MailRun BBS "BBSName" BBSName
  82.     LastBBS = BBS
  83.     LastMRun = MailRun
  84.     if FLAGS & DEFAULTS
  85.         BBSList = "DEFAULT"
  86.         BBS = "DEFAULT"
  87.     else
  88.         makebbslist()
  89.     endif
  90.     loadbbsinfo()
  91.     loadprompts()
  92.     loadmaildoor()
  93.     LastBBSType = BBSType
  94.     if FLAGS & DEFAULTS
  95.         findfirst MailRun
  96.         strfmt BBSName "BBS Info Defaults for %s" $FILENAME
  97.     endif
  98.     bbsbox()
  99.     interfaceon()
  100.     FLAGS &= UNCHANGED
  101.     if FLAGS & NEW
  102.         addbbs()
  103.         LastBBS = BBS
  104.     endif
  105.     while 1
  106.         dialogstatus = $DIALOG
  107.         switch dialogstatus
  108.             case 10
  109.                 ;User selected "Prompts"
  110.                 if FLAGS & DEFAULTS
  111.                     defaultsprompts()
  112.                 else
  113.                     cfgprompts()
  114.                 endif
  115.             endcase
  116.             case 11
  117.                 ;User selected "Mail Door"
  118.                 if FLAGS & DEFAULTS
  119.                     defaultsdoor()
  120.                 else
  121.                     cfgmaildoor()
  122.                 endif
  123.             endcase
  124.             case 12
  125.                 ;User selected "Save"
  126.                 if NULLSTR BBSName
  127.                     usermsg "You must enter the name of the BBS!"
  128.                     loopwhile
  129.                 elseif FLAGS & NEW
  130.                     writenewbbs()
  131.                     FLAGS &= OLD
  132.                 endif
  133.                 writebbsinfo()
  134.                 writeprompts()
  135.                 writemaildoor()
  136.                 if NameChanged && (j == 0)
  137.                     i = getbbscoord()
  138.                     TaskItem = gettaskstring(i, 0)
  139.                 endif
  140.                 FLAGS &= UNCHANGED
  141.             endcase
  142.             case 13
  143.                 ;User selected "Done:
  144.                 if checkchanged()
  145.                     exit
  146.                 endif
  147.             endcase
  148.             case 171
  149.                 ;User changed the BBS type
  150.                 if FLAGS & DEFAULTS
  151.                     if checkchanged()
  152.                         loadprompts()
  153.                         FLAGS &= UNCHANGED
  154.                         LastBBSType = BBSType
  155.                     else
  156.                         BBSType = LastBBSType
  157.                     endif
  158.                 else
  159.                     FLAGS |= DEFAULTS
  160.                     loadprompts()
  161.                     FLAGS &= (ALLFLAGS - DEFAULTS)
  162.                 endif
  163.                 FLAGS |= CHANGED
  164.                 updatedlg -1
  165.             endcase
  166.             case 172
  167.                 ;User changed the mail door type
  168.                 if FLAGS & DEFAULTS
  169.                     loadmaildoor()
  170.                 else
  171.                     FLAGS |= DEFAULTS
  172.                     loadmaildoor()
  173.                     FLAGS &= (ALLFLAGS - DEFAULTS)
  174.                 endif
  175.                 FLAGS |= CHANGED
  176.             endcase
  177.             case 173
  178.                 ;User changed BBS ID with combobox
  179.                 if checkchanged()
  180.                     loadbbsinfo()
  181.                     loadprompts()
  182.                     loadmaildoor()
  183.                     i = getbbscoord()
  184.                     j = 0
  185.                     TaskItem = gettaskstring(i, 0)
  186.                     FLAGS &= UNCHANGED
  187.                     LastBBS = BBS
  188.                     updatedlg -1
  189.                 else
  190.                     BBS = LastBBS
  191.                     updatedlg 512
  192.                 endif
  193.             endcase
  194.             case 230
  195.                 NameChanged = 1
  196.                 FLAGS |= CHANGED
  197.             endcase
  198.             case 70
  199.             case 170
  200.             case 231
  201.             case 232
  202.             case 233
  203.             case 234
  204.             case 235
  205.             case 236
  206.             case 237
  207.             case 238
  208.             case 239
  209.                 FLAGS |= CHANGED
  210.             endcase
  211.         endswitch
  212.     endwhile
  213. endproc
  214.  
  215.  
  216. #comment
  217. *********************************************************************
  218. * CHANGEPROMPTS()
  219. * Called by main()
  220. * Calls getbbsi(), makebbslist(), promptbox(), loadprompts(),
  221. * writeprompts(), interfaceon(), defaultsbbs(), defaultsdoor(),
  222. * cfgbbs(), cfgmaildoor(), exportprompts(), checkchanged(),
  223. * getbbscoord(), gettaskstring()
  224. * Allows the user to change the prompts for a given BBS in
  225. * the *.MRN file.  If DEFAULTS flag is set, changes default
  226. * prompts for the current BBS type.
  227. *********************************************************************
  228. #endcomment
  229.  
  230. proc changeprompts
  231. string LastBBS, LastMRun, LastBBSType
  232. integer dialogstatus, i
  233.     i = getbbsi()
  234.     profilerd MailRun BBS "BBSName" BBSName
  235.     LastBBS = BBS
  236.     LastMRun = MailRun
  237.     profilerd MailRun BBS "BBSType" BBSType
  238.     if FLAGS & DEFAULTS
  239.         profilerd MailRun "DEFAULT" "BBSType" BBSType
  240.         BBSList = "DEFAULT"
  241.         BBS = "DEFAULT"
  242.     else
  243.         makebbslist()
  244.     endif
  245.     loadprompts()
  246.     LastBBSType = BBSType
  247.     promptbox()
  248.     FLAGS &= UNCHANGED
  249.     interfaceon()
  250.     while 1
  251.         dialogstatus = $DIALOG
  252.         switch dialogstatus
  253.             case 10
  254.                 ;User selected "BBS Info"
  255.                 if FLAGS & DEFAULTS
  256.                     defaultsbbs()
  257.                 else
  258.                     cfgbbs()
  259.                 endif
  260.             endcase
  261.             case 11
  262.                 ;User selected "Mail Door"
  263.                 if FLAGS & DEFAULTS
  264.                     defaultsdoor()
  265.                 else
  266.                     cfgmaildoor()
  267.                 endif
  268.             endcase
  269.             case 12
  270.                 ;User selected "Export"
  271.                 exportprompts()
  272.             endcase
  273.             case 13
  274.                 ;User selected "Save"
  275.                 writeprompts()
  276.                 if !(FLAGS & DEFAULTS)
  277.                     profilewr MailRun BBS "BBSType" BBSType
  278.                 endif
  279.                 FLAGS &= UNCHANGED
  280.             endcase
  281.             case 14
  282.                 ;User selected "Done"
  283.                 if checkchanged()
  284.                     exit
  285.                 endif
  286.             endcase
  287.             case 170
  288.                 ;User changed BBS with the combobox
  289.                 if checkchanged()
  290.                     loadprompts()
  291.                     profilerd MailRun BBS "BBSType" BBSType
  292.                     i = getbbscoord()
  293.                     TaskItem = gettaskstring(i, 0)
  294.                     LastBBS = BBS
  295.                     updatedlg -1
  296.                 else
  297.                     BBS = LastBBS
  298.                     updatedlg 512
  299.                 endif
  300.             endcase
  301.             case 171
  302.                 ;User changed BBS type
  303.                 if FLAGS & DEFAULTS
  304.                     if checkchanged()
  305.                         loadprompts()
  306.                         updatedlg 128
  307.                         FLAGS &= UNCHANGED
  308.                         LastBBSType = BBSType
  309.                     else
  310.                         BBSType = LastBBSType
  311.                         updatedlg 512
  312.                     endif
  313.                 else
  314.                     FLAGS |= DEFAULTS
  315.                     loadprompts()
  316.                     FLAGS &= (ALLFLAGS - DEFAULTS)
  317.                     updatedlg 128
  318.                     FLAGS |= CHANGED
  319.                 endif
  320.             endcase
  321.             case 230
  322.             case 231
  323.             case 232
  324.             case 233
  325.             case 234
  326.             case 235
  327.             case 236
  328.             case 237
  329.             case 238
  330.             case 239
  331.             case 240
  332.             case 241
  333.             case 242
  334.             case 243
  335.             case 244
  336.             case 245
  337.                 FLAGS |= CHANGED
  338.             endcase
  339.         endswitch
  340.     endwhile
  341. endproc
  342.  
  343.  
  344. #comment
  345. *********************************************************************
  346. * CHANGEMAILDOOR()
  347. * Called by main()
  348. * Calls getbbsi(), makebbslist(), interfaceon(),
  349. * loadmaildoor(), writemaildoor(),
  350. * maildoorbox(), defaultsbbs(), defaultsprompts(),
  351. * cfgbbs(), cfgprompts(), exportmaildoor(), checkchanged(),
  352. * getbbscoord(), gettaskstring()
  353. * Allows the user to change the mail door prompts for a
  354. * given BBS in the *.MRN file.
  355. *********************************************************************
  356. #endcomment
  357.  
  358. proc changemaildoor
  359. string LastBBS, LastMRun, LastDoorType
  360. integer dialogstatus, i
  361.     i = getbbsi()
  362.     profilerd MailRun BBS "BBSName" BBSName
  363.     LastBBS = BBS
  364.     LastMRun = MailRun
  365.     profilerd MailRun BBS "MailDoorType" MailDoorType
  366.     if FLAGS & DEFAULTS
  367.         profilerd MailRun "DEFAULT" "MailDoorType" MailDoorType
  368.         BBSList = "DEFAULT"
  369.         BBS = "DEFAULT"
  370.     else
  371.         makebbslist()
  372.     endif
  373.     loadmaildoor()
  374.     profilerd MailRun BBS "QWKArchiver" QWKArchiver
  375.     profilerd MailRun BBS "MailXferProt" MailXferProt
  376.     LastDoorType = MailDoorType
  377.     ArcList = "arj.exe,fpzipx.exe,lha.exe,lharc.exe,pkunzip.exe,pkxarc.exe,zoo.exe"
  378.     maildoorbox()
  379.     interfaceon()
  380.     while 1
  381.         dialogstatus = $DIALOG
  382.         switch dialogstatus
  383.             case 10
  384.                 ;User selected "Prompts"
  385.                 if FLAGS & DEFAULTS
  386.                     defaultsprompts()
  387.                 else
  388.                     cfgprompts()
  389.                 endif
  390.             endcase
  391.             case 11
  392.                 ;User selected "BBS Info"
  393.                 if FLAGS & DEFAULTS
  394.                     defaultsbbs()
  395.                 else
  396.                     cfgbbs()
  397.                 endif
  398.             endcase
  399.             case 12
  400.                 ;User selected "Export"
  401.                 exportmaildoor()
  402.             endcase
  403.             case 13
  404.                 ;User selected "Save"
  405.                 writemaildoor()
  406.                 if !(FLAGS & DEFAULTS)
  407.                     profilewr MailRun BBS "MailDoorType" MailDoorType
  408.                 endif
  409.                 profilewr MailRun BBS "QWKArchiver" QWKArchiver
  410.                 profilewr MailRun BBS "MailXferProt" MailXferProt
  411.                 FLAGS &= UNCHANGED
  412.             endcase
  413.             case 14
  414.                 ;User selected "Done"
  415.                 if checkchanged()
  416.                     exit
  417.                 endif
  418.             endcase
  419.             case 170
  420.                 ;User changed mail door type
  421.                 if FLAGS & DEFAULTS
  422.                     if checkchanged()
  423.                         loadmaildoor()
  424.                         FLAGS &= UNCHANGED
  425.                         updatedlg 128
  426.                         LastDoorType = MailDoorType
  427.                     else
  428.                         MailDoorType = LastDoorType
  429.                         updatedlg 512
  430.                     endif
  431.                 else
  432.                     FLAGS |= DEFAULTS
  433.                     loadmaildoor()
  434.                     FLAGS &= (ALLFLAGS - DEFAULTS)
  435.                     FLAGS |= CHANGED
  436.                     updatedlg 128
  437.                 endif
  438.             endcase
  439.             case 173
  440.                 ;User changed the current BBS
  441.                 if checkchanged()
  442.                     loadmaildoor()
  443.                     profilerd MailRun BBS "MailDoorType" MailDoorType
  444.                     profilerd MailRun BBS "QWKArchiver" QWKArchiver
  445.                     profilerd MailRun BBS "MailXferProt" MailXferProt
  446.                     i = getbbscoord()
  447.                     TaskItem = gettaskstring(i, 0)
  448.                     LastBBS = BBS
  449.                     updatedlg -1
  450.                 else
  451.                     BBS = LastBBS
  452.                     updatedlg 512
  453.                 endif
  454.             endcase
  455.             case 171
  456.             case 172
  457.             case 230
  458.             case 231
  459.             case 232
  460.             case 233
  461.             case 234
  462.             case 235
  463.                 FLAGS |= CHANGED
  464.             endcase
  465.         endswitch
  466.     endwhile
  467. endproc
  468.                 
  469.  
  470. #comment
  471. *********************************************************************
  472. * ADDBBS()
  473. * Called by changeuserinfo()
  474. * Calls fverify(), inlist(), loadbbsinfo(), loadprompts(), 
  475. * loadmaildoor()
  476. * Adds a BBS to the *.MRN file, assigning default info
  477. * and prompts.
  478. *********************************************************************
  479. #endcomment
  480.  
  481. proc addbbs
  482. string NewBBS
  483.     while 1
  484.         sdlginput "BBS ID" "Enter the ID of the BBS:" NewBBS
  485.         if FAILURE
  486.             exit 
  487.         endif
  488.         strlwr NewBBS
  489.         if not fverify(NewBBS)
  490.             usermsg "A bulletin board's BBS ID is the same as the \
  491. name of it's QWK packet.  It must be a valid DOS \
  492. file name without the extension."
  493.         elseif inlist(NewBBS, BBSList) 
  494.             errormsg "That BBS is already in the MailRun!"
  495.         else
  496.             exitwhile
  497.         endif
  498.     endwhile
  499.  
  500.     ;If there is no previously existing information for the new BBS,
  501.     ;assign the defaults, otherwise, use the old info.
  502.     ;Any previously entered BBS will have a name.
  503.  
  504.     BBS = NewBBS
  505.     profilerd MailRun BBS "BBSName" BBSName
  506.     if NULLSTR BBSName
  507.         ;Load defaults
  508.         FLAGS |= DEFAULTS
  509.         loadbbsinfo()
  510.         BBSName = ""
  511.         loadprompts()
  512.         loadmaildoor()
  513.         FLAGS &= (ALLFLAGS - DEFAULTS)
  514.     else
  515.         loadbbsinfo()
  516.         loadprompts()
  517.         loadmaildoor()
  518.     endif
  519.     FLAGS |= CHANGED
  520.     ;Add the new BBS to the BBS list
  521.     if not NULLSTR BBSList
  522.         strfmt BBSList "%s,%s" BBSList BBS
  523.     else
  524.         BBSList = BBS
  525.     endif
  526.     updatedlg -1
  527. endproc
  528.  
  529.  
  530. #comment
  531. *********************************************************************
  532. * EXPORTPROMPTS()
  533. * Called by changeprompts()
  534. * Calls findstring(), writeprompts(), makebbstypelist(),
  535. * inlist()
  536. * Creates a new BBS type with current prompt set.
  537. *********************************************************************
  538. #endcomment
  539.  
  540. proc exportprompts
  541. string NewBBSType, BBSType_X
  542. integer i
  543.     while 1
  544.         NewBBSType = BBSType
  545.         sdlginput "Export Prompts" "Name the new prompt set:" \
  546.             NewBBSType DEFAULT
  547.         if FAILURE
  548.             return
  549.         endif
  550.         if inlist(NewBBSType, BBSTypeList) 
  551.             usermsg "There is already a prompt set for %s!" NewBBSType
  552.             loopwhile
  553.         endif
  554.         if !(findstring(NewBBSType "PCBoard") || \
  555.             findstring(NewBBSType, "WildCat") || \
  556.             findstring(NewBBSType, "Auntie") || findstring(NewBBSType, "RBBS"))
  557.             usermsg "The name of the prompt set must contain a \
  558. keyword indicating the type of BBS.  Valid keywords are `"PCBoard,`" \
  559. `"WildCat,`" `"RBBS`" and `"Auntie.`""
  560.             loopwhile
  561.         endif
  562.         exitwhile
  563.     endwhile
  564.     i = 1
  565.     strfmt BBSType_X "BBSType_%d" i
  566.     profilerd MailRunIni "BBSTypes" BBSType_X BBSType
  567.     while not NULLSTR BBSType
  568.         i++
  569.         strfmt BBSType_X "BBSType_%d" i
  570.         profilerd MailRunIni "BBSTypes" BBSType_X BBSType
  571.     endwhile
  572.     BBSType = NewBBSType
  573.     profilewr MailRunIni "BBSTypes" BBSType_X BBSType
  574.     if FLAGS & DEFAULTS
  575.         writeprompts()
  576.     else
  577.         FLAGS |= DEFAULTS
  578.         writeprompts()
  579.         FLAGS &= (ALLFLAGS - DEFAULTS)
  580.     endif
  581.     makebbstypelist()
  582.     updatedlg 512
  583. endproc
  584.  
  585.  
  586. #comment
  587. *********************************************************************
  588. * EXPORTMAILDOOR()
  589. * Called by changemaildoor()
  590. * Calls writemaildoor(), makemaildoorlist(), inlist()
  591. * Adds a BBS to the *.MRN file, assigning default info
  592. * and prompts.
  593. *********************************************************************
  594. #endcomment
  595.  
  596. proc exportmaildoor
  597. string NewMailDoorType, MailDoor_X
  598. integer i
  599.     while 1
  600.         NewMailDoorType = MailDoorType
  601.         sdlginput "Export Prompts" "Name the new mail door:" \
  602.             NewMailDoorType DEFAULT
  603.         if FAILURE
  604.             return
  605.         endif
  606.         if inlist(NewMailDoorType, MailDoorList) 
  607.             usermsg "There is already a prompt set for %s!" \
  608.                 NewMailDoorType
  609.             loopwhile
  610.         endif
  611.         exitwhile
  612.     endwhile
  613.     i = 1
  614.     strfmt MailDoor_X "MailDoor_%d" i
  615.     profilerd MailRunIni "MailDoors" MailDoor_X MailDoorType
  616.     while not NULLSTR MailDoorType
  617.         i++
  618.         strfmt MailDoor_X "MailDoor_%d" i
  619.         profilerd MailRunIni "MailDoors" MailDoor_X MailDoorType
  620.     endwhile
  621.     MailDoorType = NewMailDoorType
  622.     profilewr MailRunIni "MailDoors" MailDoor_X MailDoorType
  623.     if FLAGS & DEFAULTS
  624.         writemaildoor()
  625.     else
  626.         FLAGS |= DEFAULTS
  627.         writemaildoor()
  628.         FLAGS &= (ALLFLAGS - DEFAULTS)
  629.     endif
  630.     makemaildoorlist()
  631.     updatedlg 512
  632. endproc
  633.  
  634.  
  635. #comment
  636. *********************************************************************
  637. * INLIST()
  638. * Called by addbbs(), exportprompts(), exportmaildoor()
  639. * Returns 1 if the first string parameter is contained in
  640. * the second string, which must be a comma delimited list;
  641. * otherwise returns 0.
  642. *********************************************************************
  643. #endcomment
  644.  
  645. func inlist: integer
  646. strparm LookString, ListString
  647. string Element
  648. integer i = 0
  649.     strextract Element ListString "," i
  650.     while not NULLSTR Element
  651.         if strcmpi Element LookString
  652.             return 1
  653.         endif
  654.         i++
  655.         strextract Element ListString "," i
  656.     endwhile
  657.     return 0 
  658. endfunc
  659.  
  660.  
  661. #comment
  662. *********************************************************************
  663. * BBSBOX()
  664. * Called by changeuserinfo()
  665. * Displays the BBS Information dialog box.
  666. *********************************************************************
  667. #endcomment
  668.  
  669. proc bbsbox
  670. destroydlg
  671. HelpPage = 5
  672. dialogbox 24 36 320 215 15 "BBS Information" helpid HelpPage
  673.    text  142 10 40 8 right "BBS Name:"
  674.    editbox 186 8 121 12 BBSName
  675.    groupbox 10 28 138 156 "BBS Info" shadow
  676.    text  13 47 62 8 right "User ID:"
  677.    text  13 67 62 8 right "Password:"
  678.    text  13 87 62 8 right "Xfer Protocol:"
  679.    text  13 107 62 11 right "Calling From:"
  680.    text  13 127 62 8 right "User Response 1:"
  681.    text  13 147 62 8 right "User Response 2:"
  682.    text  27 167 92 8 right "Language/Prompt Scheme:"
  683.    editbox 79 45 60 12 UserName
  684.    editbox 79 65 60 12 PWord
  685.    combobox 79 85 60 42 ProtList XferProt sort
  686.    editbox 79 105 60 12 CallingFrom
  687.    editbox 79 125 60 12 UserResp1
  688.    editbox 79 145 60 12 UserResp2
  689.    editbox 123 165 16 12 LangNumber
  690.    checkbox 187 174 90 12 "Display ANSI Graphics " GraphicsOn
  691.    groupbox 158 29 150 79 "Phone Numbers" shadow
  692.    text  162 49 35 8 right "Node 1:"
  693.    text  162 69 35 8 right "Node 2:"
  694.    text  162 89 35 8 right "Node 3:"
  695.    editbox 201 47 100 12 Number_1
  696.    editbox 201 67 100 12 Number_2
  697.    editbox 201 87 100 12 Number_3
  698.    groupbox 158 115 150 50 shadow
  699.    text  160 128 39 8 right "BBS Type:"
  700.    text  171 145 39 8 right "Mail Door:"
  701.    combobox 202 124 98 42 BBSTypeList BBSType sort
  702.    combobox 214 143 76 42 MailDoorList MailDoorType sort
  703.    pushbutton 42 193 52 14 "&Prompts" normal
  704.    pushbutton 104 193 52 14 "&Mail Door" normal
  705.    pushbutton 169 193 52 14 "&Save" normal default
  706.    pushbutton 232 193 52 14 "&Done" normal
  707.    text  28 10 36 8 right "BBS ID:"
  708.    combobox 68 8 66 42 BBSList BBS sort
  709. enddialog
  710. endproc
  711.  
  712.  
  713. #comment
  714. *********************************************************************
  715. * PROMPTBOX()
  716. * Called by changeprompts()
  717. * Displays the BBS Prompts dialog box.
  718. *********************************************************************
  719. #endcomment
  720.  
  721. proc promptbox
  722. destroydlg
  723. HelpPage = 6
  724. dialogbox 14 36 324 209 15 "BBS Prompts" HELPID HelpPage
  725.    groupbox 13 30 297 147 shadow
  726.    text  18 44 56 8 right "Language:"
  727.    text  18 60 56 8 right "ANSI Graphics:"
  728.    text  18 76 56 8 right "Name:"
  729.    text  18 92 56 8 right "Password:"
  730.    text  18 108 56 8 right "User Prompt 1:"
  731.    text  18 124 56 8 right "User Prompt 2:"
  732.    text  18 140 56 8 right "View:"
  733.    text  18 156 56 8 right "Scan Msg Base:"
  734.    editbox 78 42 76 12 LangPrompt
  735.    editbox 78 58 76 12 GraphicsPrompt
  736.    editbox 78 74 76 12 NamePrompt
  737.    editbox 78 90 76 12 PWordPrompt
  738.    editbox 78 106 76 12 UserPrompt1
  739.    editbox 78 122 76 12 UserPrompt2
  740.    editbox 78 138 76 12 ViewPrompt
  741.    editbox 78 154 76 12 ScanPrompt
  742.    text  160 44 56 8 right "File Prompt:"
  743.    text  160 60 56 8 right "More:"
  744.    text  160 76 56 8 right "Continue:"
  745.    text  160 92 56 8 right "Command:"
  746.    text  160 108 56 8 right "File Unavailable:"
  747.    text  160 124 56 8 right "File Description:"
  748.    text  160 140 56 8 right "Start File D/L:"
  749.    text  160 156 56 8 right "Start File U/L:"
  750.    editbox 220 42 76 12 FilePrompt
  751.    editbox 220 58 76 12 MorePrompt
  752.    editbox 220 74 76 12 ContinuePrompt
  753.    editbox 220 90 76 12 CommandPrompt
  754.    editbox 220 106 76 12 DLUnavPrompt
  755.    editbox 220 122 76 12 ULDescPrompt
  756.    editbox 220 138 76 12 DLPrompt
  757.    editbox 220 154 76 12 ULPrompt
  758.    pushbutton 22 187 48 14 "&BBS Info" normal
  759.    pushbutton 80 187 48 14 "&Mail Door" normal
  760.    pushbutton 138 187 48 14 "&Export" normal
  761.    pushbutton 196 187 48 14 "&Save" normal default
  762.    pushbutton 254 187 48 14 "&Done" normal
  763.    text  12 14 42 8 right "Prompts for:"
  764.    combobox 58 12 72 42 BBSList BBS sort
  765.    text  134 14 68 8 right "Prompts based on:"
  766.    combobox 206 12 100 42 BBSTypeList BBSType sort
  767. enddialog
  768. endproc
  769.  
  770.  
  771. #comment
  772. *********************************************************************
  773. * MAILDOORBOX()
  774. * Called by changemaildoor()
  775. * Displays the Mail Door dialog box.
  776. *********************************************************************
  777. #endcomment
  778.  
  779. proc maildoorbox
  780. destroydlg
  781. HelpPage = 7
  782. dialogbox 8 36 342 165 15 "Mail Door" helpid HelpPage
  783.    groupbox 12 33 156 93 shadow
  784.    text  20 48 62 8 right "Start Mail Door:"
  785.    text  20 68 62 8 right "Prompts Based on:"
  786.    text  20 88 62 8 right "QWK Archiver:"
  787.    text  20 108 62 8 right "Transfer Protocol:"
  788.    editbox 86 46 70 12 MailDoor
  789.    combobox 86 66 70 42 MailDoorList MailDoorType sort
  790.    combobox 86 86 70 42 ArcList QWKArchiver sort
  791.    combobox 86 106 70 42 ProtList MailXferProt sort
  792.    groupbox 180 11 150 115 "Prompts" shadow
  793.    text  190 28 56 8 right "Message Menu:"
  794.    text  190 48 56 8 right "Mail Command:"
  795.    text  190 68 56 8 right "Receive Packet:"
  796.    text  190 88 56 8 right "Start Mail U/L:"
  797.    text  190 108 56 8 right "Start Mail D/L:"
  798.    editbox 250 25 70 12 MsgMenuPrompt
  799.    editbox 250 46 70 12 MailPrompt
  800.    editbox 250 66 70 12 ReceiveQWKPrompt
  801.    editbox 250 86 70 12 MailULPrompt
  802.    editbox 250 106 70 12 MailDLPrompt
  803.    text  19 13 53 8 right "Mail Door for:"
  804.    combobox 76 11 77 42 BBSList BBS sort
  805.    pushbutton 22 139 50 14 "&Prompts" normal
  806.    pushbutton 84 139 50 14 "&BBS Info" normal
  807.    pushbutton 146 139 50 14 "&Export" normal
  808.    pushbutton 208 139 50 14 "&Save" normal default
  809.    pushbutton 270 139 50 14 "&Done" normal
  810. enddialog
  811. endproc
  812.  
  813.  
  814. #comment
  815. *********************************************************************
  816. * MAKEPROTLIST()
  817. * Called by main()
  818. * Creates a list of transfer protocols for display in the
  819. * bbsbox() dialog box protocol combobox.
  820. *********************************************************************
  821. #endcomment
  822.  
  823. proc makeprotlist
  824. string ProtName
  825. integer i
  826.     i = 0
  827.     ProtList = ""
  828.     getitem PROTOCOL i ProtName
  829.     while not NULLSTR ProtName
  830.         strfmt ProtList "%s,%s" ProtList ProtName
  831.         i++
  832.         getitem PROTOCOL i ProtName
  833.     endwhile
  834.     strdelete ProtList 0 1
  835. endproc
  836.  
  837.  
  838. #comment
  839. *********************************************************************
  840. * MAKEMAILDOORLIST()
  841. * Called by main(), exportmaildoor()
  842. * Creates a list of mail doors for display the mail door
  843. * combobox of the BBS info and Mail Door dialog boxes.
  844. *********************************************************************
  845. #endcomment
  846.  
  847. proc makemaildoorlist
  848. string MailDoor_X, DoorType
  849. integer i
  850.     MailDoorList = ""
  851.     i = 1
  852.     profilerd MailRunIni "MailDoors" "MailDoor_1" DoorType
  853.     while not NULLSTR DoorType
  854.         strfmt MailDoorList "%s,%s" MailDoorList DoorType
  855.         i++
  856.         strfmt MailDoor_X "MailDoor_%d" i
  857.         profilerd MailRunIni "MailDoors" MailDoor_X DoorType
  858.     endwhile
  859.     if i > 1
  860.         strdelete MailDoorList 0 1
  861.     endif
  862. endproc
  863.  
  864.  
  865. #comment
  866. *********************************************************************
  867. * MAKEBBSTYPELIST()
  868. * Called by main(), exportprompts()
  869. * Creates a list of BBS types for display the BBS type
  870. * combobox of the BBS info and BBS prompt dialog boxes.
  871. *********************************************************************
  872. #endcomment
  873.  
  874. proc makebbstypelist
  875. string BBSType_X, BoardType
  876. integer i
  877.     BBSTypeList = ""
  878.     i = 1
  879.     profilerd MailRunIni "BBSTypes" "BBSType_1" BoardType
  880.     while not NULLSTR BoardType
  881.         strfmt BBSTypeList "%s,%s" BBSTypeList BoardType
  882.         i++
  883.         strfmt BBSType_X "BBSType_%d" i
  884.         profilerd MailRunIni "BBSTypes" BBSType_X BoardType
  885.     endwhile
  886.     if i > 1
  887.         strdelete BBSTypeList 0 1
  888.     endif
  889. endproc
  890.  
  891.  
  892. #comment
  893. *********************************************************************
  894. * WRITENEWBBS()
  895. * Called by changeuserinfo()
  896. * Calls insertbbs(), writebbs()
  897. * If the NEW flag is set, writes the information for the
  898. * new BBS to the *.MRN file.
  899. *********************************************************************
  900. #endcomment
  901.  
  902. proc writenewbbs
  903. string char
  904. integer i
  905.     ;Determine the insertion point  and renumber all following BBSs
  906.     if not NULLSTR TaskItem
  907.         strextract char TaskItem "`t" 3
  908.         ;i is the BBS coordinate
  909.         atoi char i
  910.         insertbbs(i, BBS)
  911.     else
  912.         i = 0
  913.         writebbs(1, BBS)
  914.     endif
  915.     i++
  916.     strfmt TaskItem "%s`t`t`t%d`t0" BBSName i
  917. endproc
  918.